import efinance as ef
# 股票代码
# stock_code = '399001'
stock_code = '000001'
# sh_index=ef.stock.get_members('上证指数')
sh_index=ef.stock.get_members(stock_code)
print(sh_index)
# 获取相应股票代码数据到Pandas 数据结构 - DataFrame
stock_code_data=ef.stock.get_base_info(stock_code)
print(stock_code_data)